package com.tjetc.controller;

import com.tjetc.common.JsonResult;
import com.tjetc.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("tags")
public class TagsController {
    @Autowired
    TagService tagService;
    @RequestMapping("insert")
    public JsonResult insert(@RequestParam("tagName")String tagName) {
        return tagService.addTag(tagName);
    }
    @RequestMapping("all")
    public JsonResult selectall() {
        return tagService.allTag();
    }
    @RequestMapping("test")
    public JsonResult test() {
        return tagService.test();
    }
}
